Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Anomaly Detection: Consolidate severity colors #204803

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

walterra
Copy link
Contributor

Summary

Part of #140695.

We defined the hex codes for anomaly detection severity colors in several places. This PR consolidates this and makes sure the hex codes are defined in just one place. Note this PR doesn't change any of the colors or styling related to anomaly detection, it is pure refactoring to make future updates to these colors more easy.

  • Renames BLANK to UNKNOWN to be in line with severity labels.
  • Uses ML_SEVERITY_COLORS.* in test assertions so future color changes won't need updating every assertion.
  • Migrates all SCSS that made use of severity colors to emotion so it can reuse ML_SEVERITY_COLORS. Therefor the SCSS based severity colors get removed in this PR.

Checklist

  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines

@walterra walterra added :ml Feature:Anomaly Detection ML anomaly detection release_note:skip Skip the PR/issue when compiling release notes v9.0.0 backport:version Backport to applied version labels v8.18.0 labels Dec 18, 2024
@walterra walterra self-assigned this Dec 18, 2024
@walterra walterra requested review from a team as code owners December 18, 2024 16:58
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@rbrtj rbrtj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, left some notes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion to update the function description above

Suggested change
Returns a severity RGB color (one of critical, major, minor, warning, low or unknown)

unknown instead of blank

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting this, updated in 98d1a09.

.range([
ML_SEVERITY_COLORS.LOW,
ML_SEVERITY_COLORS.WARNING,
ML_SEVERITY_COLORS.MINOR,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR and MAJOR are slightly different here (than #ffdd00 and #ff7e00), but I assume this is intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again thanks for your attention to detail! Discussed with Pete and we can't remember if this was intentional or an oversight originally, so we'll move forward with the consolidation to make it the same color.

},

'&.low': {
fill: mlColors.lowWarning,
fill: ML_SEVERITY_COLORS.LOW,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noting, it might be intentional as well but ML_SEVERITY_COLORS.LOW is different than mlColors.lowWarning

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the other, comment above, not sure if this was intentional or oversight way back.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 6477 6478 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
apm 5.6MB 5.6MB +8.0B
ml 4.7MB 4.7MB -6.9KB
uptime 467.5KB 467.5KB +8.0B
total -6.9KB

History

cc @walterra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels Feature:Anomaly Detection ML anomaly detection :ml release_note:skip Skip the PR/issue when compiling release notes v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants